package me.khrystal.rxnews.widget.refresh;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

/**
 * usage:
 * author: kHRYSTAL
 * create time: 16/4/8
 * update time:
 * email: 723526676@qq.com
 */
public abstract class RefreshHead extends View {

    public RefreshHead(Context context){
        super(context);
    }

    public RefreshHead(Context context, AttributeSet attrs){
        super(context,attrs);
    }

    public RefreshHead(Context context,AttributeSet attrs,int defStyleAttr){
        super(context,attrs,defStyleAttr);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public RefreshHead(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
        super(context,attrs,defStyleAttr,defStyleRes);
    }

    /**
     * is refreshing
     */
    public abstract boolean isLoading();

    public abstract boolean isReadyLoad();

    /**
     * 加载完成 移除加载动画
     */
    public abstract void performLoaded();

    /**
     * 执行加载动画
     */
    public abstract void performLoading();

    /**
     * 响应拉动时的操作
     * @param v
     */
    public abstract void performPull(float v);

}
